import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gczn_hd/app/core/base/base_view.dart';
import 'package:gczn_hd/app/core/base/handle_mixin.dart';
import 'package:gczn_hd/app/core/values/app_colors.dart';
import 'package:gczn_hd/app/core/values/app_values.dart';
import 'package:gczn_hd/app/core/values/text_styles.dart';
import 'package:gczn_hd/app/core/widget/custom_app_bar.dart';
import 'package:gczn_hd/app/core/widget/gczn_card.dart';
import 'package:gczn_hd/app/modules/qms/check_detail/widget/bad_drawer.dart';
import 'package:gczn_hd/app/modules/qms/check_detail/widget/check_order_detail.dart';
import 'package:gczn_hd/app/modules/qms/check_detail/widget/check_order_msg.dart';

import 'package:get/get.dart';

import '../controllers/check_detail_controller.dart';

class CheckDetailView extends BaseView<CheckDetailController> with HandleMixin{
  final Size btnSize =   Size(173.w, 60.h);
 
 @override
  PreferredSizeWidget? appBar(BuildContext context) => CustomAppBar(appBarTitleText: "检验详情", actions: [
    Row(
        mainAxisAlignment: MainAxisAlignment.center,
        children: <Widget>[
          SizedBox(width: btnSize.width, height: btnSize.height, child:  ElevatedButton(
            onPressed: () {
              showToast("保存中");
            },
            style: ElevatedButton.styleFrom(
                backgroundColor: AppColors.gcznPrimaryColorCan,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(AppValues.margin_12.r),
                    bottomLeft: Radius.circular(AppValues.margin_12.r),
                  ),
                ),
            ),
            child: Text('保存', style: submitButtonText,),
          ),),
          SizedBox(width: btnSize.width, height: btnSize.height, child: ElevatedButton(
            onPressed: () {
              showToast("提交了");
            },
            style: ElevatedButton.styleFrom(
                backgroundColor: AppColors.gcznPrimaryBlueColorBtn,
                shape: RoundedRectangleBorder(
                  borderRadius: BorderRadius.only(
                    topRight: Radius.circular(AppValues.margin_12.r),
                    bottomRight: Radius.circular(AppValues.margin_12.r),
                  ),
                ),
                // fixedSize: Size(btnSize.width.w, btnSize.height.h)
            ),
            child: Text('提交', style: submitButtonText,),
          )),
          SizedBox(
            width: AppValues.size30.w,
          )
        ],
      )
  ],);


  @override
  Widget body(BuildContext context) {
    const double boxWidth = 587.0;
    const double boxHeight = 870.0;

    return SingleChildScrollView(
      child: Container(
        padding: EdgeInsets.only(top: AppValues.size40.h, left: AppValues.size40.w, right: AppValues.size40.w),
        child: Row(
          children: [
            GcznCard(
              child: Container(
                width: boxWidth.w,
                height: boxHeight.h,
                padding:  EdgeInsets.only(top: AppValues.size28.h, left: AppValues.size26.w, bottom: AppValues.size28.h, right: AppValues.size26.w),
                child: SingleChildScrollView(
                  child: checkOrderMsg()
                ),
              ),
            ),
            SizedBox(width: AppValues.size40.w,),
            Expanded(
              flex: 1,
              child: GcznCard(
                child: Container(
                    height: boxHeight.h,
                    padding: EdgeInsets.only(top: AppValues.size28.h, left: AppValues.size26.w, bottom: AppValues.size28.h, right: AppValues.size26.w),
                    child: CheckOrderDetail()
                ),
              ),
            )

          ],
        ),
      ),
    );

  }


 @override
  Widget? endDrawer() {

    return BadDrawer();
  }


}
